import { IApiGameEndReq, IApiGameEndRes, IApiGameStartReq, IApiGameStartRes, IApiPlayerJoinReq, IApiPlayerJoinRes, IApiPlayerListReq, IApiPlayerListRes, IApiRoomCreateReq, IApiRoomCreateRes, IApiRoomJoinReq, IApiRoomJoinRes, IApiRoomLeaveReq, IApiRoomLeaveRes, IApiRoomListReq, IApiRoomListRes } from "./Api"
import { ApiMsgEnum } from "./Enum"
import { IMsgClientSync, IMsgGameEnd, IMsgGameStart, IMsgPlayerList, IMsgRoom, IMsgRoomList, IMsgServerSync } from "./Msg"
/**
 * api：API消息主要用于客户端向服务器发起请求，需要服务器响应，类似HTTP的请求-响应模式.例如：加入房间、创建房间等操作
 * msg：Msg消息主要用于服务器向客户端推送信息,用于实时同步和广播,不需要响应,可以频繁发送.例如：游戏状态同步、玩家输入同步等
 * 
 * req：是客户端发送给服务器的请求参数类型
 * res：是服务器返回给客户端的响应数据类型
 */
export interface IModel{
    api:{
        [ApiMsgEnum.ApiPlayerJoin]:{
            req:IApiPlayerJoinReq
            res:IApiPlayerJoinRes
        }
        [ApiMsgEnum.ApiPlayerList]:{
            req:IApiPlayerListReq
            res:IApiPlayerListRes
        }
        [ApiMsgEnum.ApiRoomCreate]:{
            req:IApiRoomCreateReq
            res:IApiRoomCreateRes
        }
        [ApiMsgEnum.ApiRoomList]:{
            req:IApiRoomListReq
            res:IApiRoomListRes
        }
        [ApiMsgEnum.ApiRoomJoin]:{
            req:IApiRoomJoinReq
            res:IApiRoomJoinRes
        }
        [ApiMsgEnum.ApiRoomLeave]:{
            req:IApiRoomLeaveReq
            res:IApiRoomLeaveRes
        }
        [ApiMsgEnum.ApiGameStart]:{
            req:IApiGameStartReq
            res:IApiGameStartRes
        }
        [ApiMsgEnum.ApiGameEnd]:{
            req:IApiGameEndReq
            res:IApiGameEndRes
        }
    }
    msg:{   
        [ApiMsgEnum.MsgPlayerList]:IMsgPlayerList
        [ApiMsgEnum.MsgRoomList]:IMsgRoomList
        [ApiMsgEnum.MsgRoom]:IMsgRoom
        [ApiMsgEnum.MsgGameStart]:IMsgGameStart
        [ApiMsgEnum.MsgClientSync]:IMsgClientSync
        [ApiMsgEnum.MsgServerSync]:IMsgServerSync
        [ApiMsgEnum.MsgGameEnd]:IMsgGameEnd
    }
}